package offer;

import java.util.HashSet;
import java.util.Set;

public class IsStraight_66 {
    public boolean isStraight(int[] nums) {
        if(nums.length == 0) return false;
        Set<Integer> repeat = new HashSet<>();
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        for (int num : nums) {
            if(num == 0){
                continue;
            }
            if(repeat.contains(num)){
                return false;
            }
            max = Math.max(num,max);
            min = Math.min(num,min);
            repeat.add(num);
        }
        return max - min < 5;





    }
}
